<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<!--头部导航栏-->
<!-- th:fragment=""提取公共部分的代码 --><!-- th:repalce=""替换 -->
<nav class="navbar navbar-inverse navbar-fixed-top" th:fragment="topbar">
	<div class="container-fluid">
		<div class="navbar-header">
			<button type="button" class="navbar-toggle collapsed"
				data-toggle="collapse" data-target="#navbar" aria-expanded="false"
				aria-controls="navbar">
				<span class="sr-only"></span> <span class="icon-bar"></span> <span
					class="icon-bar"></span> <span class="icon-bar"></span>
			</button>
			<a class="navbar-brand" href="#">欢迎~~[[${session.loginUser}]]</a>
		</div>
		<div id="navbar" class="navbar-collapse collapse">
			<ul class="nav navbar-nav navbar-right">
				<li><a th:href="@{/main.html}">主页</a></li>
				<li><a href="#">设置</a></li>
				<li><a href="#">项目</a></li>
				<li><a th:href="@{/user/logout}">注销</a></li>
			</ul>
			<form class="navbar-form navbar-right">
				<input type="text" class="form-control" placeholder="搜索">
			</form>
		</div>
	</div>
</nav>

<!--侧边栏-->
<!-- th:fragment=""提取公共部分的代码 -->
<div class="col-sm-3 col-md-2 sidebar" th:fragment="sidebar">
	<ul class="nav nav-sidebar">
		<!-- 如果是当前页面高亮，反之普通 -->
		<li th:class="${active == 'main.html' ? 'active' : ''}"><a
			th:href="@{/main.html}">主页</a></li>
		<li th:class="${active == 'list.html' ? 'active' : ''}"><a
			th:href="@{/emps}">员工列表</a></li>
		<li th:class="${active == 'user.html' ? 'active' : ''}"><a
			th:href="@{/users}">使用者</a></li>
		<li th:class="${active == 'userpage.html' ? 'active' : ''}"><a
			href="/user/findAll">用户分页</a></li>
		<li th:class="${active == 'main2.html' ? 'active' : ''}"><a
			href="#">列表3</a></li>
	</ul>
	<ul class="nav nav-sidebar">
		<li><a href="#">列表3</a></li>
		<li><a href="#">列表3</a></li>
	</ul>
</div>


</html>